﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Enterprise.Migrations
{
    public partial class EditHisGlucoseRec : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "SIMPLE_ITEM_CODE",
                table: "HIS_GLUCOSE_REC");

            migrationBuilder.DropColumn(
                name: "SIMPLE_ITEM_NAME",
                table: "HIS_GLUCOSE_REC");

            migrationBuilder.DropColumn(
                name: "SIMPLE_TYPE_CODE",
                table: "HIS_GLUCOSE_REC");

            migrationBuilder.RenameColumn(
                name: "GLUCOSE_VALUES",
                table: "HIS_GLUCOSE_REC",
                newName: "GLUCOSE_VALUE");

            migrationBuilder.AlterColumn<string>(
                name: "VISIT_ID",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "PATIENT_ID",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "CREATED_BY_NAME",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "CREATED_BY",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "GLUCOSE_ITEM_NAME",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(60)",
                nullable: false,
                defaultValue: "");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "GLUCOSE_ITEM_NAME",
                table: "HIS_GLUCOSE_REC");

            migrationBuilder.RenameColumn(
                name: "GLUCOSE_VALUE",
                table: "HIS_GLUCOSE_REC",
                newName: "GLUCOSE_VALUES");

            migrationBuilder.AlterColumn<string>(
                name: "VISIT_ID",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)");

            migrationBuilder.AlterColumn<string>(
                name: "PATIENT_ID",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)");

            migrationBuilder.AlterColumn<string>(
                name: "CREATED_BY_NAME",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)");

            migrationBuilder.AlterColumn<string>(
                name: "CREATED_BY",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "VARCHAR(20)");

            migrationBuilder.AddColumn<int>(
                name: "SIMPLE_ITEM_CODE",
                table: "HIS_GLUCOSE_REC",
                type: "INT",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "SIMPLE_ITEM_NAME",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(60)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SIMPLE_TYPE_CODE",
                table: "HIS_GLUCOSE_REC",
                type: "VARCHAR(20)",
                nullable: true);
        }
    }
}
